-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: pass reply_builder explicitly to pubsub module #4021
Conversation
Also, deprecate `reply_builder()` access method. Signed-off-by: Roman Gershman <[email protected]>
@@ -137,61 +145,13 @@ void ConnectionContext::ChangeMonitor(bool start) { | |||
EnableMonitoring(start); | |||
} | |||
|
|||
vector<unsigned> ChangeSubscriptions(bool pattern, CmdArgList args, bool to_add, bool to_reply, | |||
ConnectionContext* conn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved below to be a method of ConnectionContext
@@ -21,6 +21,17 @@ namespace dfly { | |||
using namespace std; | |||
using namespace facade; | |||
|
|||
static void SendSubscriptionChangedResponse(string_view action, std::optional<string_view> topic, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved here from below
@@ -269,6 +217,53 @@ size_t ConnectionContext::UsedMemory() const { | |||
return facade::ConnectionContext::UsedMemory() + dfly::HeapSize(conn_state); | |||
} | |||
|
|||
vector<unsigned> ConnectionContext::ChangeSubscriptions(CmdArgList channels, bool pattern, | |||
bool to_add, bool to_reply) { | |||
vector<unsigned> result(to_reply ? channels.size() : 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was a free function, now it's a method.
@@ -36,17 +36,10 @@ class ConnectionContext { | |||
return protocol_; | |||
} | |||
|
|||
SinkReplyBuilder* reply_builder() { | |||
SinkReplyBuilder* reply_builder_old() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you called this _old?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so that we won't use it. I will remove it in follow up PRs
Also, deprecate
reply_builder()
access method.Finally, remove reply builder injection as its not needed anymore - we always pass this object via stack.